package com.authine.cloudpivot.ext.Enum;

/**
 * 付款申请类型
 */
public enum PaymentApplyTypeEnum {
    /**
     *
     */
    ALL(0, "全部"),
    BALANCE(1, "余额付款"),
    BANK(2, "银行转账"),
    MONEY(3, "现金"),
    PAPER_BILL_OF_EXCHANGE(4, "银行承兑汇票"),
    ELECTRONIC_BILL_OF_EXCHANGE(5, "电子承兑支票"),
    ALI_PAY(6, "支付宝");


    public Integer id;
    public String text;

    private PaymentApplyTypeEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static PaymentApplyTypeEnum get(Integer code) {

        for (PaymentApplyTypeEnum c : PaymentApplyTypeEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
